/**
 * 村镇介绍JS
 * @author Assassin
 */

// 保存村镇信息
function executeTownInfoSave() {
    var title = $.trim($('#title').val());
    if(shiro.util.isEmpty(title)) {
        layer.tips('介绍标题不能为空', '#title');
        return false;
    }
    var content = CKEDITOR.instances.content_editor.getData();
    if(shiro.util.isEmpty(content)) {
        layer.msg('介绍内容不能为空', {icon: 5,time: 1000});
        return false;
    }
    var townId = $.trim($('#townId').val());
    // 提交登录
    shiro.ajax({
        url: 'town/save',
        data:{'townId':townId, 'title': title, "content":content},
        success: function(data) {
            if(data.result == 0) {
                layer.msg(data.message, {icon: 1,time: 1000}, function() {
                    window.location.href = shiro.baseUrl + "town/info";
                });
            } else {
                layer.msg(data.message, {icon: 5,time: 1000});
                $('#title').val('');
            }
        }
    });
    return false;
}